using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using clf.weighing.entity;

namespace weighing
{

    /// <summary>
    /// 设备表
    /// 数据条数:0
    /// 数据大小:16KB
    /// </summary>


    public class DeviceVo : BaseVo
    {
        #region Constract
        public Device mDevice;
        public DeviceVo(Device device)
        {
            mDevice = device;
        }
        #endregion


        /// <summary>
        /// 可空:NO
        /// </summary>

        public Int64 Id { get { return mDevice.id; } set { mDevice.id = value; OnPropertyChanged(this, nameof(Id)); } }

        /// <summary>
        /// 可空:YES
        /// </summary>

        public String Name { get { return mDevice.name; } set { mDevice.name = value; OnPropertyChanged(this, nameof(Name)); } }


        public String MAC { get { return mDevice.mac; } set { mDevice.mac = value; OnPropertyChanged(this, nameof(MAC)); } }

        /// <summary>
        /// 可空:YES
        /// </summary>

        public String Ip { get { return mDevice.ip; } set { mDevice.ip = value; OnPropertyChanged(this, nameof(Ip)); } }

        /// <summary>
        /// 注释:端口
        /// 可空:YES
        /// </summary>

        public Int32? Port { get { return mDevice.port; } set { mDevice.port = value; OnPropertyChanged(this, nameof(Port)); } }

        /// <summary>
        /// 注释:用户名
        /// 可空:YES
        /// </summary>

        public String UserName { get { return mDevice.userName; } set { mDevice.userName = value; OnPropertyChanged(this, nameof(UserName)); } }

        /// <summary>
        /// 注释:登陆密码
        /// 可空:YES
        /// </summary>

        public String Password { get { return mDevice.password; } set { mDevice.password = value; OnPropertyChanged(this, nameof(Password)); } }

        /// <summary>
        /// 注释:类型 0其它 1摄像头 2抓拍机 3硬盘录像机 4道闸 7红外感应器 10 称重显示器
        /// 可空:YES
        ///默认值:0
        /// </summary>

        public Int32? Type { get { return mDevice.type; } set { mDevice.type = value; OnPropertyChanged(this, nameof(Type)); } }

        /// <summary>
        /// 注释:状态 1 正常 0 异常
        /// 可空:YES
        ///默认值:1
        /// </summary>

        public Int32? Status { get { return mDevice.status; } set { mDevice.status = value; OnPropertyChanged(this, nameof(Status)); } }

        public Int32? ResultIncludeMac { get { return mDevice.resultIncludeMac; } set { mDevice.resultIncludeMac = value; OnPropertyChanged(this, nameof(ResultIncludeMac)); } }

        /// <summary>
        /// 可空:YES
        ///默认值:0
        /// </summary>

        public Int32? IsDelete { get { return mDevice.isDelete; } set { mDevice.isDelete = value; OnPropertyChanged(this, nameof(IsDelete)); } }

        /// <summary>
        /// 可空:YES
        /// </summary>

        public DateTime? DeleteTime { get { return mDevice.deleteTime; } set { mDevice.deleteTime = value; OnPropertyChanged(this, nameof(DeleteTime)); } }

        /// <summary>
        /// 注释:同步时间
        /// 可空:YES
        ///默认值:0
        /// </summary>

        public Int64? SyncTime { get { return mDevice.syncTime; } set { mDevice.syncTime = value; OnPropertyChanged(this, nameof(SyncTime)); } }

        /// <summary>
        /// 注释:位置(0未知 1 前 2 后 3 上 4屏幕截图)
        /// 可空:NO
        ///默认值:0
        /// </summary>

        public Int32 Position { get { return mDevice.position; } set { mDevice.position = value; OnPropertyChanged(this, nameof(Position)); } }

        /// <summary>
        /// 注释:安装位置
        /// 可空:YES
        ///默认值:其它
        /// </summary>

        public String PositionName { get { return mDevice.positionName; } set { mDevice.positionName = value; OnPropertyChanged(this, nameof(PositionName)); } }

        /// <summary>
        /// 注释:备注
        /// 可空:YES
        /// </summary>

        public String Remark { get { return mDevice.remark; } set { mDevice.remark = value; OnPropertyChanged(this, nameof(Remark)); } }

        /// <summary>
        /// 可空:YES
        /// </summary>

        public DateTime? Addtime { get { return mDevice.addTime; } set { mDevice.addTime = value; OnPropertyChanged(this, nameof(Addtime)); } }

        /// <summary>
        /// 可空:YES
        /// </summary>

        public Int64? AddUserId { get { return mDevice.addUserId; } set { mDevice.addUserId = value; OnPropertyChanged(this, nameof(AddUserId)); } }

        /// <summary>
        /// 可空:YES
        /// </summary>

        public String AddUserName { get { return mDevice.addUserName; } set { mDevice.addUserName = value; OnPropertyChanged(this, nameof(AddUserName)); } }

        /// <summary>
        /// 可空:YES
        /// </summary>

        public DateTime UpdateTime { get { return mDevice.updateTime; } set { mDevice.updateTime = value; OnPropertyChanged(this, nameof(UpdateTime)); } }

        /// <summary>
        /// 可空:YES
        /// </summary>

        public Int64? UpdateUserId { get { return mDevice.updateUserId; } set { mDevice.updateUserId = value; OnPropertyChanged(this, nameof(UpdateUserId)); } }

        /// <summary>
        /// 可空:YES
        /// </summary>

        public DateTime? UpdateUserName { get { return mDevice.updateUserName; } set { mDevice.updateUserName = value; OnPropertyChanged(this, nameof(UpdateUserName)); } }

        /// <summary>
        /// 注释:NVR通道号
        /// 可空:YES
        /// </summary>

        public String Channels { get { return mDevice.channels; } set { mDevice.channels = value; OnPropertyChanged(this, nameof(Channels)); } }

        /// <summary>
        /// 注释:所属客户端
        /// 可空:YES
        ///默认值:0
        /// </summary>

        public Int64? ClientId { get { return mDevice.clientId; } set { mDevice.clientId = value; OnPropertyChanged(this, nameof(ClientId)); } }

        /// <summary>
        /// 注释:所属公司
        /// 可空:YES
        ///默认值:0
        /// </summary>

        public Int64? CompanyId { get { return mDevice.companyId; } set { mDevice.companyId = value; OnPropertyChanged(this, nameof(CompanyId)); } }


        #region TEXT

        public String TypeText
        {
            get
            {
                if (Type == (int)DeviceType.NetScanner)
                {
                    return "扫码器";
                }
                if (Type == (int)DeviceType.NVR)
                {
                    return "硬盘录像机";
                }
                return "未知";
            }
        }

        public String PositionText
        {
            get
            {
                if (Type == (int)DeviceType.NetScanner)
                {
                    return Position == 1 ? "入场" : Position == 2 ? "出场" : "未知";
                }
                else
                {
                    return Position == 1 ? "前" : Position == 2 ? "后" : Position == 3 ? "顶" : "未知";
                }
            }
        }
        public String ResultIncludeMacText
        {
            get
            {
                return ResultIncludeMac == 1 ? "包含" : "否";
            }
        }

        #endregion
    }
}
